import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/Login.vue'
import Home from '@/views/Home.vue'
import Dept from '@/views/subViews/Dept.vue'
import Good from '@/views/subViews/Good.vue'
import Access from '@/views/subViews/Access.vue'
import System from '@/views/subViews/System.vue'
import Order from '@/views/subViews/Order.vue'
import DeptInfo from '@/views/subViews/DeptInfo.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'/login',
    },
    {
      path:'/login',
      component :Login
    },
    {
      path:'/home',
      redirect:'/home/dept',
      component :Home,
      children: [
        {
          path: 'dept',
          component :Dept
        },
        {
          path: 'good',
          component :Good
        },
        {
          path: 'order',
          component :Order
        },
        {
          path: 'system',
          component :System
        },
        {
          path: 'access',
          component :Access
        },
        {
          path: 'deptinfo/:id',
          component :DeptInfo
        },
      ]
    },
   
// 再配置一个路由规则
  ],
})

export default router
